import { useCssVar } from '@vueuse/core'
import { defineStore } from 'pinia'

export const useThemeStore = defineStore(
  'theme',
  () => {
    const primaryColor = useCssVar('--el-color-primary')
    const changePrimaryColor = (color) => {
      primaryColor.value = color
    }

    return {
      primaryColor,
      changePrimaryColor,
    }
  },
  { persist: true },
)
